/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'PingFang SC', 'Helvetica Neue', Arial, sans-serif;
}

body {
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
    font-size: 14px;
    overflow-x: hidden;
}

.page {
    display: none;
    width: 100%;
    min-height: 100vh;
}

.page.active {
    display: block;
}

.btn {
    background-color: #ff6700;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
}

.btn:hover {
    background-color: #ff4500;
}

.btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* 登录/注册页面样式 */
.login-container {
    max-width: 350px;
    margin: 50px auto;
    padding: 20px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.login-container h1 {
    text-align: center;
    margin-bottom: 20px;
    color: #333;
}

.input-group {
    margin-bottom: 15px;
    position: relative;
}

.input-group i {
    position: absolute;
    left: 10px;
    top: 10px;
    color: #999;
}

.input-group input {
    width: 100%;
    padding: 10px 10px 10px 35px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.register-link {
    text-align: center;
    margin-top: 15px;
    color: #666;
}

.register-link a {
    color: #ff6700;
    text-decoration: none;
}

/* 应用主页面样式 */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background-color: #ff6700;
    color: white;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    height: 50px;
}

.header-left {
    display: flex;
    align-items: center;
}

.menu-icon {
    font-size: 20px;
    margin-right: 15px;
    cursor: pointer;
}

.app-title {
    font-size: 18px;
}

.cart-icon {
    position: relative;
    font-size: 18px;
    cursor: pointer;
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: #ff0000;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 侧边栏样式 */
.sidebar {
    position: fixed;
    top: 50px;
    left: -250px;
    width: 250px;
    height: calc(100vh - 50px);
    background-color: white;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
    transition: left 0.3s;
    z-index: 99;
    overflow-y: auto;
}

.sidebar.active {
    left: 0;
}

.sidebar-header {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid #eee;
}

.user-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin-bottom: 10px;
    object-fit: cover;
}

.sidebar-menu {
    list-style: none;
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: #333;
    text-decoration: none;
    border-left: 3px solid transparent;
    transition: all 0.2s;
}

.menu-item i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

.menu-item.active {
    background-color: #f9f9f9;
    border-left: 3px solid #ff6700;
    color: #ff6700;
}

.menu-item:hover {
    background-color: #f5f5f5;
}

/* 主要内容区域 */
.main-content {
    margin-top: 50px;
    margin-bottom: 60px;
    padding: 15px;
    min-height: calc(100vh - 110px);
}

.content-page {
    display: none;
}

.content-page.active {
    display: block;
}

/* 搜索框样式 */
.search-box {
    display: flex;
    margin-bottom: 15px;
}

.search-box input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px 0 0 4px;
    font-size: 14px;
}

.search-box button {
    padding: 0 15px;
    background-color: #ff6700;
    color: white;
    border: none;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
}

/* 轮播图样式 */
.banner {
    margin-bottom: 15px;
    border-radius: 4px;
    overflow: hidden;
}

.banner-slide {
    display: none;
}

.banner-slide.active {
    display: block;
}

.banner-slide img {
    width: 100%;
    height: auto;
    display: block;
}

/* 分类网格样式 */
.categories {
    margin-bottom: 20px;
}

.section-title {
    font-size: 16px;
    margin-bottom: 10px;
    color: #333;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.category-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: white;
    padding: 10px;
    border-radius: 4px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.category-item img {
    width: 40px;
    height: 40px;
    margin-bottom: 5px;
}

.category-item span {
    font-size: 12px;
    color: #666;
}

/* 商品网格样式 */
.products-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.product-card {
    background-color: white;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s;
}

.product-card:hover {
    transform: translateY(-3px);
}

.product-image {
    width: 100%;
    height: 0;
    padding-bottom: 100%;
    position: relative;
    overflow: hidden;
}

.product-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-info {
    padding: 10px;
}

.product-name {
    font-size: 14px;
    margin-bottom: 5px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 40px;
}

.product-price {
    color: #ff6700;
    font-weight: bold;
    font-size: 16px;
}

.product-original-price {
    color: #999;
    font-size: 12px;
    text-decoration: line-through;
    margin-left: 5px;
}

.product-sales {
    font-size: 12px;
    color: #999;
    margin-top: 5px;
}

.add-to-cart {
    width: 100%;
    padding: 5px;
    background-color: #ff6700;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 5px;
    font-size: 12px;
}

/* 购物车样式 */
.cart-items {
    margin-bottom: 70px;
}

.cart-item {
    display: flex;
    background-color: white;
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.cart-item-image {
    width: 80px;
    height: 80px;
    margin-right: 10px;
}

.cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}

.cart-item-details {
    flex: 1;
}

.cart-item-name {
    font-size: 14px;
    margin-bottom: 5px;
}

.cart-item-price {
    color: #ff6700;
    font-weight: bold;
    margin-bottom: 5px;
}

.cart-item-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.quantity-selector {
    display: flex;
    align-items: center;
}

.quantity-selector button {
    width: 25px;
    height: 25px;
    background-color: #f5f5f5;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.quantity-selector input {
    width: 40px;
    height: 25px;
    text-align: center;
    margin: 0 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.remove-item {
    color: #ff6700;
    font-size: 12px;
    cursor: pointer;
}

.empty-cart {
    text-align: center;
    padding: 40px 0;
}

.empty-cart i {
    font-size: 50px;
    color: #ccc;
    margin-bottom: 15px;
}

.empty-cart p {
    color: #999;
    margin-bottom: 15px;
}

.cart-summary {
    position: fixed;
    bottom: 60px;
    left: 0;
    right: 0;
    background-color: white;
    padding: 10px 15px;
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.summary-row {
    display: flex;
    flex-direction: column;
}

.summary-row span:first-child {
    font-size: 12px;
    color: #666;
}

.summary-row span:last-child {
    font-size: 18px;
    color: #ff6700;
    font-weight: bold;
}

.checkout-btn {
    padding: 10px 20px;
    font-size: 14px;
}

/* 商品详情页样式 */
.product-detail {
    background-color: white;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.product-images {
    width: 100%;
}

.main-image {
    width: 100%;
    height: 0;
    padding-bottom: 100%;
    position: relative;
}

.main-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-info {
    padding: 15px;
}

.product-info h1 {
    font-size: 18px;
    margin-bottom: 10px;
}

.price-section {
    margin-bottom: 10px;
}

.current-price {
    font-size: 20px;
    color: #ff6700;
    font-weight: bold;
}

.original-price {
    font-size: 14px;
    color: #999;
    text-decoration: line-through;
    margin-left: 10px;
}

.sales-info {
    display: flex;
    justify-content: space-between;
    color: #999;
    font-size: 12px;
    margin-bottom: 15px;
}

.product-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
}

.quantity-selector {
    display: flex;
    align-items: center;
}

.quantity-selector button {
    width: 30px;
    height: 30px;
    background-color: #f5f5f5;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
}

.quantity-selector input {
    width: 50px;
    height: 30px;
    text-align: center;
    margin: 0 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.product-description {
    padding: 15px;
}

.product-description h3 {
    font-size: 16px;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
}

/* 我的页面样式 */
.profile-header {
    padding: 20px;
    text-align: center;
    background-color: white;
    border-bottom: 1px solid #eee;
}

.profile-header .user-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin-bottom: 10px;
    object-fit: cover;
}

.profile-header h3 {
    font-size: 16px;
    margin-bottom: 5px;
}

.profile-header p {
    font-size: 12px;
    color: #999;
}

.profile-menu {
    list-style: none;
    background-color: white;
}

.profile-menu-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: #333;
    text-decoration: none;
    border-bottom: 1px solid #eee;
    transition: all 0.2s;
}

.profile-menu-item i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

.profile-menu-item:hover {
    background-color: #f5f5f5;
}

/* 底部导航样式 */
.app-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: white;
    display: flex;
    justify-content: space-around;
    padding: 10px 0;
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.1);
    z-index: 100;
}

.footer-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #666;
    text-decoration: none;
    font-size: 12px;
}

.footer-item i {
    font-size: 20px;
    margin-bottom: 3px;
}

.footer-item.active {
    color: #ff6700;
}

/* 排序选项样式 */
.sort-options {
    margin-bottom: 15px;
}

.sort-options select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: white;
}

/* 响应式调整 */
@media (max-width: 320px) {
    .products-grid {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}